<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Symbol</title>
</head>
<body>
    <script>
        // 创建 Symbol
        let s1 = Symbol();
        console.log(s1, typeof s1);

        let s2 = Symbol(`尚硅谷`);
        let s3 = Symbol(`尚硅谷`);
        console.log(s2, s3);
        console.log(s2 === s3);

        // Symbol.for 创建
        let s4 = Symbol.for(`尚硅谷`);
        let s5 = Symbol.for(`尚硅谷`)
        console.log(s4 === s5);
        console.log(s4, typeof s4);

        // 不能与其他数据进行运算
        // let result1 = s1 + 100;  ==> Uncaught TypeError: Cannot convert a Symbol value to a number
        // let result2 = s1 > 100; ==> Uncaught TypeError: Cannot convert a Symbol value to a number
        //let result3 = s1 + `100`;    ==> Uncaught TypeError: Cannot convert a Symbol value to a string

        // USONB    you are so niubility
        // u    =>  undefined
        // s    =>  string symbol
        // o    =>  object
        // n    =>  null number
        // b    =>  boolean
    </script>
</body>
</html>